package com.candy.excp;

import java.io.FileInputStream;
import java.io.FileNotFoundException;

public class Test01 {
    public static void main(String[] args) {
        test03();
    }
    public static void test03() {
        int num_03=5;
        if(num_03==5){
            throw new NullPointerException();
        }

    }


    public static void test02() throws FileNotFoundException {
        FileInputStream f=new FileInputStream("");
    }


    public static void test01() {
        try{
            int num_01=4;
            int num_02=2;
            System.out.println(num_01/num_02);
        }catch (ArithmeticException e){
            System.out.println("分母不能为0");
        }catch(NullPointerException e){
            System.out.println("空指针异常");
        }finally {
            System.out.println("代码执行完毕");
        }


    }

}
